package Filter;//package Filter;
//
//import javax.servlet.FilterChain;
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebFilter;
//import javax.servlet.http.HttpFilter;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//import java.io.IOException;
//
//
//@WebFilter("/login/dgut")
//public class TokenFilter extends  HttpFilter{
//    public void doFilter(HttpServletRequest req, HttpServletResponse resp, FilterChain chain) throws IOException, ServletException{
//
//        HttpSession user = req.getSession();
//        String token = req.getParameter("token");
//        if(token == null && user.getAttribute("username") == null) {
//            resp.sendRedirect("https://cas.dgut.edu.cn?appid=javaee&state=STATE");
//        }
//        else
//            chain.doFilter(req, resp);
//    }
//}